<!DOCTYPE html>
<html>
<head>
	<title>06-proxy</title>
	<script type="text/javascript" src="js/mummy.js" charset="utf-8"></script>

</head>

<body>

<script type="text/javascript" charset="utf-8">

Interface(function EtreVivant(){

	this.quiSuisJe = function(){};
	this.getNom = function(){};
	this.setNom = function(){};

});

Class({
	$implements:[EtreVivant],
	$define:function Humain(){
		this.Nom;
		this.getNom=function(){return this.Nom;}
		this.setNom=function(value){this.Nom=value;}
		this.Humain=function(nom){this.Nom=nom;}
		this.quiSuisJe=function(){
			console.log(this.getNom()+', je suis un : '+this.getTypeName());
		}
	}

});


Class({
	$implements:[EtreVivant],
	$define:function Homme(){
		this.humain;
		this.Sexe = "MASCULIN";
		
		this.Homme=function(humain){
			this.humain = humain;
		}
		
		this.getNom=function(){return this.humain.getNom();}
		this.setNom=function(value){this.humain.setNom(value);}

		this.quiSuisJe=function(){
			console.log('Hello,');
			this.humain.quiSuisJe();
			console.log(this.getTypeName());
			console.log('Sexe '+this.Sexe);
		}
	}

});

Class({
	$implements:[EtreVivant],
	$define:function Femme(){
		this.humain;
		this.Sexe = "FEMININ";

		this.Femme=function(humain){
			this.humain = humain;
		}

		this.getNom=function(){return this.humain.getNom();}
		this.setNom=function(value){this.humain.setNom(value);}

		this.quiSuisJe=function(){
			console.log('Hello,');
			this.humain.quiSuisJe();
			console.log(this.getTypeName());
			console.log('Sexe '+this.Sexe);
		}
	}

});

var Lara = $(Femme).getNew($(Humain).getNew('Lara Croft'));
var Bob = $(Homme).getNew($(Humain).getNew('Bob Morane'));

Lara.quiSuisJe();
Bob.quiSuisJe();

</script>



</body>
</html>
